| complex (1) | template<class T> complex<T> proj (const complex<T>& x); |
|---|
| complex (1) | template<class T> complex<T> proj (const complex<T>& x); |
|---|---|
| arithmetic type (2) | complex<double> conj (ArithmeticType x); |
0.0 or -0.0 (where supported), depending on the sign of the imaginary component of x.complex<double>, except if the argument is float or long double (in which case, the return type is the complex instantiation for that type: either complex<float> or complex<long double>).1
2
3
4
5
6
7
8
9
10
11
12
13
// proj example
#include <iostream> // std::cout
#include <complex> // std::complex, std::proj
#include <limits> // std::numeric_limits
int main ()
{
std::complex<double> mycomplex (std::numeric_limits<double>::infinity(),2.0);
std::cout << "The projection of " << mycomplex << " is " << std::proj(mycomplex) << '\n';
return 0;
}
The projection of (inf,2) is (inf,0)